import "../style.scss";
import Button from "./button/button.vue";
import Input from "./input/input.vue";
import InputNumber from "./input-number/input-number.vue";
import DatePicker from "./date-picker/date-picker.vue";
import TimePicker from "./time-picker/time-picker.vue"
import ScrollBar from "./scrollbar/scrollbar.vue";
import Dialog from "./dialog/dialog.vue";
import Alert from "./alert/alert.vue";
import Avatar from "./avatar/avatar.vue";
import Badge from "./badge/badge.vue";
import Card from "./card/card.vue";
import Calendar from "./calendar/calendar.vue";
import Switch from "./switch/switch.vue";
import Drawer from "./drawer/drawer.vue";
import Carousel from "./carousel/carousel.vue"
import CarouselItem from "./carousel/carousel-item.vue"
import Progress from "./progress/progress.vue"
import Toolipt from "./tooltip/tooltip.vue"
import RadioGroup from "./radio/radio-group.vue";
import Radio from "./radio/radio.vue";
import RadioButton from "./radio/radio-button.vue";
import CheckboxGroup from "./checkbox/checkbox-group.vue";
import Checkbox from "./checkbox/checkbox.vue";
import CheckboxButton from "./checkbox/checkbox-button.vue";
import Tabs from "./tabs/tabs.vue";
import TabsPane from "./tabs/tab-pane.vue";
import Transfer from "./transfer/transfer.vue";
import Collapse from "./collapse/collapse.vue";
import CollapseItem from "./collapse/collapse-item.vue";
import Tag from "./tag/tag.vue";
import Select from "./select/select.vue";
import Option from "./select/option.vue";
import OptionGroup from "./select/option-group.vue";
import Popconfirm from "./popconfirm/popconfirm.vue";

// 消息弹出
import PeMessage from "./alert/message";

// 图标
import Arrowdown from "../icons/arrowdown.vue";
import CalendarIcon from "../icons/calendar.vue";
import Check from "../icons/check.vue";
import Circleclosefilled from "../icons/circleclosefilled.vue";
import Clock from "../icons/clock.vue";
import Close from "../icons/close.vue";
import Error from "../icons/error.vue";
import Info from "../icons/info.vue";
import Loading from "../icons/loading.vue";
import Success from "../icons/success.vue";
import Warning from "../icons/warning.vue";

// 自定义指令
import directive from "../directive";

import { ref } from "vue";

// 按需引入
export {
    Button, Input, InputNumber, DatePicker, TimePicker, ScrollBar, Dialog, Alert, Avatar, Badge, Card, Calendar, Switch, Drawer, Carousel, CarouselItem, Progress, Toolipt,
    Radio, RadioGroup, RadioButton, CheckboxGroup, Checkbox, CheckboxButton, Tabs, TabsPane, Transfer, Collapse, CollapseItem, Tag, Select, Option, OptionGroup, Popconfirm
};

export { PeMessage };

// 图标
export { Arrowdown, CalendarIcon, Check, Circleclosefilled, Clock, Close, Error, Info, Loading, Success, Warning }

const component = [Button, Input, InputNumber, DatePicker, TimePicker, ScrollBar, Dialog, Alert, Avatar, Badge, Card, Calendar, Switch, Drawer, Carousel, CarouselItem, Progress, Toolipt,
    Radio, RadioGroup, RadioButton, CheckboxGroup, Checkbox, CheckboxButton, Tabs, TabsPane, Transfer, Collapse, CollapseItem, Tag, Select, Option, OptionGroup, Popconfirm
];

const dir = [
    {
        name: "loading",
        value: directive.loading
    },
    {
        name: "click-outside",
        value: directive.clickOutside
    }
]

const PeasUI = {
    install(App: any) {
        component.forEach(item => {
            App.component(item.name, item);
        });
        dir.forEach(item => {
            App.directive(item.name, item.value)
        })
        const zIndex = ref<number>(2000)
        App.provide("pe-z-index", zIndex)
    }
};

export default PeasUI;